package com.qf.service.impl;

import com.qf.entity.Goods;
import com.qf.mapper.GoodsMapper;
import com.qf.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements IGoodsService {

    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public List<Goods> selectAll() {
        List<Goods> goods = goodsMapper.selectAll();
        return goods;
    }

    @Override
    public Goods selectGoods(String title) {
        Goods goods = goodsMapper.selectGoods(title);
        return goods;
    }

    @Override
    public List<Goods> selectById(Integer[] goodsId) {
        List<Goods> goods = goodsMapper.selectById(goodsId);
        return goods;
    }

    @Override
    public List<Goods> getGoodsById(Integer id) {
        return goodsMapper.getGoodsById(id);
    }

    @Override
    public List<Goods> selectInventory(Integer[] goodsId, Integer[] stockNum) {
        List<Goods> goods = goodsMapper.selectInventory(goodsId, stockNum);
        return goods;
    }
}
